import aiohttp
import asyncio

url_list = [
    'https://kr.shanghai-jiuxin.com/file/mm/20210503/0yuonplsphe.jpg',
    'https://kr.shanghai-jiuxin.com/file/mm/20210503/f0qbuophvkr.jpg',
    'https://kr.wzh3c.com/file/mm/20210503/2vvm2glxboz.jpg',
    'http://kr.shanghai-jiuxin.com/file/mm/20210503/y200jppiq5e.jpg',
    'http://kr.shanghai-jiuxin.com/file/mm/20210503/yznbw3e5pnm.jpg',
    'http://kr.shanghai-jiuxin.com/file/mm/20210503/5diccg3omln.jpg',
    'http://kr.shanghai-jiuxin.com/file/mm/20210503/ucevkb3sn2e.jpg',
    'http://kr.shanghai-jiuxin.com/file/mm/20210503/kua4w1hpmjf.jpg',
    'http://kr.shanghai-jiuxin.com/file/mm/20210503/2a2uyjlbdaa.jpg',
    'http://kr.shanghai-jiuxin.com/file/mm/20210503/e5njd1mfijx.jpg',
    'http://kr.shanghai-jiuxin.com/file/mm/20210503/4wzieuu3tr2.jpg',
    'http://kr.shanghai-jiuxin.com/file/mm/20210503/as1tovmnmze.jpg',
    'http://kr.shanghai-jiuxin.com/file/mm/20210503/2tjlmdtz531.jpg'
]

async def download(session, url):
    async with session.get(url) as response:
        file_name = url.rsplit('/', 1)[1]
        img_data = await response.content.read()
        with open(file_name, 'wb') as fp:
            fp.write(img_data)
        print(file_name, '下载完成')


async def main():
    async with aiohttp.ClientSession() as session:
        tasks = [asyncio.create_task(download(session, url)) for url in url_list]
        await asyncio.wait(tasks)

if __name__ == '__main__':
    asyncio.run(main())